﻿:On Error Exit

USE master
GO

IF EXISTS (SELECT NULL FROM sysdatabases WHERE name = '$(DatabaseName)')
BEGIN
	ALTER DATABASE $(DatabaseName) SET SINGLE_USER WITH ROLLBACK IMMEDIATE
	DROP DATABASE $(DatabaseName)
END
GO

CREATE DATABASE $(DatabaseName)
GO
